

/*
CREATE TABLE `auth_user` (
  `gid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `appid` varchar(32) DEFAULT NULL,
  `deviceid` varchar(32) DEFAULT NULL,
  `zone_id` varchar(4) DEFAULT NULL,
  `mphone` varchar(16) DEFAULT '0',
  `reg_time` bigint(8) unsigned DEFAULT NULL,
  `nickname` varchar(16) DEFAULT NULL,
  `headimg` varchar(256) DEFAULT NULL,
  `lastlogin_time` bigint(8) unsigned DEFAULT NULL,
  `roletype` int(4) DEFAULT NULL,
  `logintype` int(4) DEFAULT NULL,
  `password` varchar(32) DEFAULT NULL,
  `username` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`gid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
*/
use serde::Deserialize;

#[derive(Deserialize)]
pub enum RoleType{
    Normal(i8)
}

#[crud_enable(id_name:"gid" | table_name:"auth_dusr" | formats_pg:"id:{}::uuid")]
#[derive(Clone, Debug)]
pub struct DUser {
    pub gid: Option<u32>,
    pub mphone: Option<String>,
    pub email: Option<String>,
    pub reg_time: Option<u64>,
    pub nick_name: Option<String>,
    pub roletype: Option<u8>,
    pub last_logintime: Option<u64>,
    pub pwd: Option<String>
}